import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'

export default defineConfig({
  plugins: [
    vue(),
    // 如果需要配置选项，可以传入对象
   /* monacoEditorPlugin({
      languageWorkers: ['json', 'css', 'html', 'typescript', 'editorWorkerService']
    }),*/
  ],
  server: {
    hmr: true,
    port: 80,
    open: true,
    proxy: {
      "/api": {
        target: 'http://59.110.20.114:8101',
        changeOrigin: true,
        secure: false,
        rewrite: (path) => path.replace(/^\/api/, ''),
      }
    }
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    },
  },
})
